/**
 * Desenvolvido pela Fábrica de Software do CESUPA.
 * Todos os direitos reservados.
 */
package br.cesupa.fabsoft.nomedoprojeto.system.application;

import java.util.Locale;
import javax.faces.context.FacesContext;

/**
 *
 * @author Breno Leite 
 */
public class ApplicationDefaults {

    public static final Locale DEFAULT_LOCALE = new Locale("pt", "BR");

    public static ApplicationConfiguration getDefaultApplicationConfiguration() {
        ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration();
        Locale viewDefaultLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
        if (viewDefaultLocale != null) {
            applicationConfiguration.setLocale(viewDefaultLocale);
        } else {
            applicationConfiguration.setLocale(DEFAULT_LOCALE);
        }
        return applicationConfiguration;
    }
}
